﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using Common;

namespace WidgetApplication
{
    public static class Program
    {
        private static QueueHandler queueHandler;
        private static InventoryRequestHandler inventoryRequestHandler;

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Init();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1(queueHandler));
            
        }

        public static void Init()
        {
            queueHandler = new QueueHandler(Constants.WIDGET_INVENTORY_REQUEST_QUEUE, Constants.WidgetInventoryRequestSchema);
            inventoryRequestHandler = new InventoryRequestHandler(queueHandler);
            queueHandler.StartListner();
        }

        public static void Stop()
        {
            queueHandler.StopListener();
        }
    }
}
